package com.zbkj.service.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.zbkj.common.model.user.UserBalanceRecord;
import com.zbkj.common.request.PageParamRequest;
import com.zbkj.common.request.UserBalanceSearchRequest;
import com.zbkj.common.response.UserBalancePageDataResponse;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
*  UserBalanceRecordService 接口
 
*/
public interface UserBalanceRecordService extends IService<UserBalanceRecord> {

    /**
     * 获取用户消费记录
     */
    List<UserBalanceRecord> getMonetaryRecordByUid(Integer uid);

    /**
     * 获取用户充值记录
     */
    List<UserBalanceRecord> getRechargeRecordByUid(Integer uid);

    /**
     * 用户余额记录
     * @param uid 用户id
     * @param recordType 记录类型：all-全部，expenditure-支出，income-收入
     * @param pageRequest 分页参数
     * @return PageInfo
     */
    PageInfo<UserBalanceRecord> getUserBalanceRecord(Integer uid, String recordType, PageParamRequest pageRequest);

    BigDecimal getTodayConsumeAmount(Integer userId);

    BigDecimal getWeekConsumeAmount(Integer userId);

    BigDecimal getMonthConsumeAmount(Integer userId);

    UserBalanceRecord getPrevPaidMemberConsume(Integer uid, String orderNo);

    UserBalanceRecord getNewOrderConsume(Integer uid, Date createTime);

    UserBalanceRecord getPaidMemberConsumeByDate(Integer uid, String orderNo, Date date);

    UserBalanceRecord getPaidMemberConsumeByDate(Integer uid, String orderNo, LocalDateTime weekStart, LocalDateTime weekEnd);

    PageInfo<UserBalancePageDataResponse> getUserBalanceList(UserBalanceSearchRequest request, PageParamRequest pageParamRequest);

}